package monopoli.communication;


import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 * @author Marco
 */
public class Message implements Serializable{

    static final long serialVersionUID = 71101545465416421L;


    public static final int TYPE_PING = 1;
    public static final int TYPE_REQUEST= 2;

    public static final int TYPE_TOKEN  = 3;
    public static final int TYPE_NOTIFY  = 4;

    public static final int SUBTYPE_NOTIFY_MOVE_PEDINA = 7;
    public static final int SUBTYPE_NOTIFY_BUY_PROPERTY = 8;
    public static final int SUBTYPE_NOTIFY_BUILD_BUILDING = 9;
    public static final int SUBTYPE_NOTIFY_PAYMENT = 10;
    public static final int SUBTYPE_NOTIFY_WITHDRAWAL = 11;
    public static final int SUBTYPE_NOTIFY_MORTGAGE = 12;
    public static final int SUBTYPE_NOTIFY_END_GAME = 13;
    public static final int SUBTYPE_NOTIFY_AUCTION_STARTED = 14;
    public static final int SUBTYPE_NOTIFY_DEATH_PLAYER = 15;
    public static final int SUBTYPE_NOTIFY_GET_PROPERTY = 16;
    public static final int SUBTYPE_NOTIFY_PEDINA = 17;
    public static final int SUBTYPE_NOTIFY_NAME = 18;
    public static final int SUBTYPE_NOTIFY_MSG = 19;

    public static final int TYPE_NULL = 20;
    public static final int SUBTYPE_NULL = 21;
    
    public static final int TYPE_ERROR = 22;

    public static final int TYPE_PING_FAIL = -10;
    public static final int TYPE_TOKEN_RING_FAIL = -20;




    //Attributes
    private long id;
    private String idComplete;
    private String text;
    private int type;
    private int subtype;
    private int tour;
    private ArrayList<Object> payload;



    
    //Constructors
    public Message () {
    }
    
    public Message (long id, String idComplete, String text, int type, int subtype, ArrayList<Object> payload) {
        this.id = id;
        this.idComplete = "";
        this.text = text;
        this.type = type;
        this.subtype = subtype;
        this.payload = payload;
    }


    //Public Methods
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getIdComplete() {
        return idComplete;
    }

    public void setIdComplete(String idComplete) {
        this.idComplete = idComplete;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
    
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getSubtype() {
        return subtype;
    }

    public void setSubtype(int subtype) {
        this.subtype = subtype;
    }

    public int getTour() {
        return tour;
    }

    public void setTour(int tour) {
        this.tour = tour;
    }

    public ArrayList<Object> getPayload() {
        return payload;
    }

    public void setPayload(ArrayList<Object> payload) {
        this.payload = payload;
    }

}

